function toast(msg,types,duration) {
    msg = msg || '';
    types = types || 'fail';
    duration = duration || 1000;
    switch(types){
        case "success"://成功
        wx.showToast({title: msg,icon:"success",duration: duration});
        break;
        case "fail"://失败
        wx.showToast({ title: msg, icon: "fail", image: '/imgs/toast_fail.png', duration: duration });
        break;
        case "noicon"://失败
        wx.showToast({ title: msg, icon: "none", duration: duration });
        break;
        case "loading"://正在加载
        wx.showToast({ title: msg, icon: "loading", duration: duration });
        break;
    }
    
}

module.exports = toast;